package com.sword.ms_bwk.furniture.util;

import com.sword.ms_bwk.ObjectInitialization;
import com.sword.ms_bwk.Utils;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.registries.RegistryObject;

public class SoundPackage {
    private boolean isKeepState;

    public RegistryObject<SoundEvent> OPEN_SOUND;
    public RegistryObject<SoundEvent> STANDBY_SOUND;
    public RegistryObject<SoundEvent> CLOSE_SOUND;

    public SoundPackage(String name, boolean isKeepState) {
        this.isKeepState = isKeepState;
        OPEN_SOUND = ObjectInitialization.SOUNDS.register(name + "_open", () -> new SoundEvent(new ResourceLocation(Utils.MOD_ID, name + ".open")));
        if (isKeepState) {
            STANDBY_SOUND = ObjectInitialization.SOUNDS.register(name + "_standby", () -> new SoundEvent(new ResourceLocation(Utils.MOD_ID, name + ".standby")));
        }
        CLOSE_SOUND = ObjectInitialization.SOUNDS.register(name + "_close", () -> new SoundEvent(new ResourceLocation(Utils.MOD_ID, name + ".close")));
    }

    public SoundPackage(String name) {
        this(name, true);
    }

    public boolean isKeepState() {
        return isKeepState;
    }
}
